/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.impl;

import java.sql.Connection;
import java.util.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
/*import model.CleanInvitation;

/**
 *
 * @author JosePortatil
 *
public class CleanInvitationImpl implements CleanInvitation{
    
    private PreparedStatement guest;
    private Date date;
    String dateString = "";
    
    public CleanInvitationImpl(){
    date = new Date();
    dateString = String.valueOf(date.getDay())+"/"+String.valueOf(date.getMonth())+"/"+String.valueOf(date.getYear());
}
    @Override
    public void clean(Connection connection){
        try{
        guest = connection.prepareStatement("SELECT * FROM invitation");
        ResultSet aux = guest.executeQuery();
        while(aux.next()){
            if(aux.getString("Date").compareTo(dateString) == -1){
                guest.executeUpdate("DELETE FROM invitation WHERE ID = "+aux.getInt("ID"));
            }
        }
        }catch(SQLException s){
            System.out.println("Deleting error on SQL: " +s);
        }
    }
    
}
*/